home *** CD-ROM | disk | FTP | other *** search
- /* WW.H: include file for wing-walk programs */
-
- #include <images.h> /* image format information */
-
- #define ABS(A) (((A) >= 0) ? (A): -(A)) /* integer absolute value */
- #define ABSF(A) (((A) >= 0.0) ? (A): -(A)) /* floating absolute value */
-
- #define DIAG 1.4142135 /* diagonal dist between pixels */
-
- /* distances are kept *100 to obtain 2 digit precision for diagonals */
- #define HORIZVERT 100 /* unit length of segment times 100 */
- #define DIAG100 141 /* unit diagonal distance times 100 */
-
- #define MDFLT 5 /* max length of corner curvature */
- #define LDFLT 20 /* min length of features */
- #define MMAX 100 /* max M-width (needed for THETASMTH */
-
- #define MAXPERCODE 6 /* 3 coords per PCC * 2 no.s per coord */
- #define MAXBRPERNODE 4 /* maximum branches from a node */
-
- /* node types */
- #define ENDCOORD -1
- #define BIFCOORD -2
- #define CROSSCOORD -3
- #define STARTCOORD -4
- #define LINEBRCOORD -5
- #define BIFBRCOORD -6
- #define CROSSBRCOORD -7
-
- #define MAXADJEDGES 3 /* max adjacent edges to another edge */
-
- /* wing-walk feature types */
- #define WWSTRT 1
- #define WWCORNER 2
- #define WWCURVE 3
- #define WWEND 0
-
- #define EPSILON1 0.0 /* tolerance on min peak width */
- #define EPSILON2 0.0 /* tolerance on corner/curve arc length */
-
- #define BORDERTHETA 50.0 /* flag (anything > PI) indicates that theta
- * has not been calculated because border /*
- *
- * /* curve sweep -- indicates if the curve arc sweeps <180, >180, =180,
- * or an entire 360 degrees, ie a circle */
- #define CURVELT180 0
- #define CURVEGT180 1
- #define CURVEEQ180 2 /* semicircle */
- #define CURVEEQ360 3 /* circle */
-
- /* Wing-Walk Structures */
-
- struct wwPar {
- long m, /* middle segment length */
- l, /* total wing-walk length */
- w; /* 'wing' length */
- };
-
- /* coords in double floating precision */
- /* already defined in images.h
- * struct dpoint{
- * double x, y;
- * };
- */
-
- struct wwfeats {
- struct point strt, /* starting and ending coord.s of feature */
- end;
- struct dpoint center; /* center of curvature for curve */
- double radius; /* radius of curvature (=0 for strt line) */
- };
-
- struct edge { /* data indices between ends or jcts */
- long iLow, /* low and high indices in data array */
- iHigh;
- };
-
- struct theta { /* theta plot */
- double theta, /* theta curvature value */
- length; /* arclength from beginning to current */
- };
-
-
- /* structures for feature linked list */
-
- struct featNode { /* feature nodes pointing to feature par.s */
- int type; /* type of wing-walk feature */
- struct dpoint intrsct; /* intersection point of tangents to curve */
- char *info; /* contains parameter information */
- struct featNode *next, /* next node */
- *previous; /* previous node */
- };
-
- struct featK { /* corner feature parameters */
- struct point coord; /* coordinate of corner feature */
- };
-
- struct featC { /* curve feature parameters */
- struct point trans1, trans2; /* beginning and ending transition points */
- struct dpoint center; /* coord. of center of circle of curvature */
- double radiusC; /* radius of curvature */
- short dirn; /* trans pts. in CCW order (1), or CW (-1) */
- };
-
- /* structures for graph representation */
-
- struct edgeList { /* list of graph edges */
- struct edge edge; /* data indices of ends of edge */
- long node1, node2; /* index of start/end nodes, -1 if no node */
- long adjEdge1[MAXADJEDGES], /* edge indices of start and end adjacent */
- adjEdge2[MAXADJEDGES], /* edges: +ve if entering, -ve if leaving */
- nAdjEdge1, nAdjEdge2; /* no. of start and end adjacent edges */
- long length; /* length * 100 */
- };
-
- struct nodeList { /* list of graph nodes */
- long type; /* node type */
- struct point locn; /* x,y location */
- long incEdge[4], /* edges incident to node */
- nEdges; /* no. edges incident to node */
- struct featNode *wwFeatPtr[2]; /* ptr to ww features in linked list */
- long nWWFeatPtr; /* no. of ww features pointed to */
- };
-
-
- struct strghtEdges { /* edge list of adjacent straight edges */
- long front, end; /* straight edge at front and end of edge */
- int flag; /* used for marking edge already counted */
- };
-